# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Luca P <meti at lplab.net>

pkgbase=luajson
pkgname=(lua52-luajson)
pkgver=1.3.4
pkgrel=3
pkgdesc="JSON parser/encoder for Lua"
url="http://luaforge.net/projects/luajson/"
arch=(any)
license=(MIT)
makedepends=(lua52-lpeg)
source=(https://github.com/harningt/$pkgbase/archive/$pkgver.tar.gz)
md5sums=('66ef8d00bcaeec91b25433a697090bc8')

package_lua52-luajson() {
  pkgdesc+=" 5.2"
  depends=(lua52-lpeg)

  cd $pkgbase-$pkgver
  make PREFIX=/usr DESTDIR="$pkgdir" \
    INSTALL_LMOD='$(INSTALL_TOP)/share/lua/5.2' \
    INSTALL_CMOD='$(INSTALL_TOP)/lib/lua/5.2' install
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 LICENSE
}
